package com;

public enum HardEnum {
	Saved("1") {
		public HardEnum nextLamp() {
			return HardEnum.valueOf("YELLOW");
		}
	},
	YELLOW("黄灯") {
		public HardEnum nextLamp() {
			return HardEnum.valueOf("GREEN");
		}
	},
	GREEN("绿灯") {
		public HardEnum nextLamp() {
			return HardEnum.valueOf("RED");
		}
	},
	UNKNOW {
		public HardEnum nextLamp() {
			if (this.ordinal() + 1 != this.values().length)
				return this.values()[this.ordinal() + 1];
			else
				return this.values()[0];
		}
	};
	private String name;

	public abstract HardEnum nextLamp();

	private HardEnum() {
		name = "未知";
	};

	private HardEnum(String n) {
		name = n;
	}
	
	public void zhang(){
		System.out.println("dong");
	}
}